package jp.co.cos.ittrick.channel.controller.client;

import jp.co.cos.ittrick.channel.service.TableService;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;

public class DeleteTableController extends Controller {

    private TableService tableService;

    public DeleteTableController() {
        tableService = new TableService();
    }

    @Override
    public Navigation run() throws Exception {

        // リクエストパラメータ
        String table = asString("table");

        // Insert
        tableService.delete(Integer.valueOf(table));

        response.setCharacterEncoding("utf-8");
        response.setContentType("text/html");
        response.getWriter().println("0");
        response.flushBuffer();

        return null;
    }
}
